package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author lizhiquan
 * @CreateDate: 2021-04-01-22-41
 * @Description:
 */
@Getter
public enum MchTypeEnum {
    OWN(1, "自有商户"),
    PLATFORM(2, "平台商户"),
    CASH_RECEIPTS(3, "现金收款"),
    BALANCE_PAYMENT(4, "余额支付"),
    DOUYIN_GROUP_PURCHASE(5, "抖音团购"),
    MEITUAN_GROUP_PURCHASE(6, "美团团购"),
    OFFLINE_COLLECTION_CODE(7, "线下收款码"),
    CUSTOMIZED_POS_COLLECTION(8, "自定义pos收款"),
    NAYAX(9, "NAYAX收款"),
    ;

    private Integer code;
    private String desc;

    MchTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDesc(Integer code) {
        MchTypeEnum[] values = MchTypeEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0) {
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
